package com.njcs.barcode;

import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;

import com.org.barcode.BarCode;

public class SwingTest extends JFrame {
	BarCode barcode;

	public void test() {
		show();
		barcode.print(getGraphics());
		setSize(barcode.getSize().width + 5, barcode.getSize().height + 25);
	}

	public SwingTest() {
		super("EAN13");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JPanel pane = new JPanel();
		pane.setLayout(new BorderLayout());
		barcode = new BarCode();
		barcode.code = "6901010101098";
		barcode.barType = BarCode.EAN13;
		pane.add("Center", barcode);
		setContentPane(pane);
	}

	public static void main(String[] arg) {
		new SwingTest().test();
	}

}